﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Diagnostics;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading;
using System.Threading.Tasks;
using System.Windows.Forms;

namespace AutoMachine
{
    internal partial class Frm_Welcome : Form
    {

        #region 窗体实例化
        /// <summary>
        /// 窗体实例化
        /// </summary>
        private static Frm_Welcome _instance;
        internal static Frm_Welcome Instance
        {
            get
            {
                if (_instance == null)
                    _instance = new Frm_Welcome();
                return _instance;
            }
        }
        #endregion

        internal Frm_Welcome()
        {
            InitializeComponent();
           Control.CheckForIllegalCrossThreadCalls = false;
        }

        


        private void FrmWelcome_Load(object sender, EventArgs e)
        {
            proStep.Maximum = 100;
        }

        //更新进度
        public void UpdateStep(int percentValue, string stepMsg)
        {
            this.proStep.Value = percentValue;
            this.lblStep.Text = stepMsg + "......";
        
            Application.DoEvents();//不加这个会卡死


        }

      //退出按钮
        private void btnExit_Click(object sender, EventArgs e)
        {
            Process.GetCurrentProcess().Kill();
        }
    }
}
